﻿namespace Example.Structural
{
    using Example.Structural.Composite;

    using Xunit;

    /// <summary>
    /// Compose objects into tree structures to represent part-whole hierarchies.
    /// Composite lets clients treat individual objects and compositions of objects uniformly.
    /// </summary>
    public sealed class CompositeFacts
    {
        [Fact]
        public void folders_with_files()
        {
            var folder = new Folder
                             {
                                 new Folder
                                     {
                                         new File(11)
                                     }, 
                                 new File(22), 
                                 new File(33)
                             };

            Assert.Equal(66, folder.Bytes);
        }
    }
}